package com.atguigu.scw.manager.controller;

import com.atguigu.scw.manager.bean.TUser;
import com.atguigu.scw.manager.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class HelloController {

    @Autowired
    UserService userService;

    @RequestMapping("/hello")
    public String hello(@RequestParam(value = "id", defaultValue = "1") Integer id,
                        Model model) {
        // TUser userById = userService.getUserById(id);
        // model.addAttribute("user", userById);
        return "forward:/testpage/success.jsp";
    }
}
